package com.niiwoo.civet.trade.utils;

/**
 * 计算相关
 * Created by zhangwanli on 2017/11/13.
 */
public class Calculator {

    /**
     * 计算自动投资优先级，权重拥有绝对控制权，权重越高优先级绝对碾压低权重<p>
     * 相同权重值下，当前时间越大(最近投资)优先级越低
     *
     * @param weight 权重 {@link com.niiwoo.civet.trade.constant.InvestPriorityWeight}
     * @return
     */
    public static double investPriority(byte weight) {
        return weight + 725299200000.0d / System.currentTimeMillis();    //725299200000.0d 代表1992-12-26 00:00:00.000 的毫秒值
    }

}
